package constant.milk.toilet.database;

import android.content.Context;

public class DbDeleteQuery
{
	private Context context;
	private DbAdapter db;
	
	public DbDeleteQuery(Context context, DbAdapter db)
	{
		this.context = context;
		this.db = db;
	}
	
	public void setBeginTansaction() throws Exception
	{
		db.beginTansaction(context);
	}
	
	public void setSuccessful() throws Exception
	{
		db.setTransactionSuccessful();
	}
	
	public void setEndTansaction() throws Exception
	{
		db.endTransaction(context);
	}
	
	public void deleteTimer(int id) throws Exception
	{
		String [] whereArgs = new String[]{id + ""};
		
		db.delete(context, TableName.TIMER_LIST, "id = ?", whereArgs);
	}
	
	public void deleteSticker(int id) throws Exception
	{
		String [] whereArgs = new String[]{id + ""};
		
		db.delete(context, TableName.STICKER_LIST, "id = ?", whereArgs);
	}
}
